<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			
			//全局变量
			console.log("a="+a);
			var a=10;
			console.log("a="+a);
			function foo1()
			{
				console.log("foo1() a="+a);
				//a=20;//全局的a
				var a=30;//内部又定义了一个a
				console.log("foo1() a="+a);
				var b=50;
			}
			foo1();
			console.log(" a="+a);
			console.log(" b="+b);
		</script>
	</body>
</html>
